heartrate13 2.2.1
Loading...
Searching...
No Matches
heartrate13


Heart Rate 13 Click

Heart Rate 13 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Nov 2024.
  • Type : I2C type

Software Support

Example Description

This example demonstrates the use of Heart Rate 13 Click board by reading and displaying the PPG measurements which can be visualized on the SerialPlot application.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.HeartRate13

Example Key Functions

Application Init

Initializes the driver and performs the Click default configuration for heart rate measurement.

void application_init ( void )
{
log_cfg_t log_cfg;
heartrate13_cfg_t heartrate13_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
heartrate13_cfg_setup( &heartrate13_cfg );
if ( I2C_MASTER_ERROR == heartrate13_init( &heartrate13, &heartrate13_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( HEARTRATE13_ERROR == heartrate13_default_cfg ( &heartrate13 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define HEARTRATE13_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition heartrate13.h:374
@ HEARTRATE13_ERROR
Definition heartrate13.h:437
void application_init(void)
Definition main.c:36
#define MIKROBUS_POSITION_HEARTRATE13
Definition main.c:30

Application Task

Waits for the data ready interrupt, then reads the PPG measurements and displays it on the USB UART (SerialPlot).

void application_task ( void )
{
if ( HEARTRATE13_OK == heartrate13_get_pd_data ( &heartrate13, &pd_data ) )
{
log_printf ( &logger, "%u\r\n", pd_data.pd3 );
}
}
@ HEARTRATE13_OK
Definition heartrate13.h:436
void application_task(void)
Definition main.c:72
uint16_t pd3
Definition heartrate13.h:391

Note

We recommend using the SerialPlot tool for data visualizing.

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.